
const { Comment } = require('../../../model/comment');

module.exports = async (req, res) => {
  const { id, user } = req.body
  const current = await Comment.findOne({_id: id})
  const comment = Comment.updateOne({_id: id}, {
	likeNum: current.likeNum + 1
  }, (err, row) => {
    if(!err) {
      res.json({
        message: '更新成功!'
      })
    } else {
      res.status(403)
      res.json({
        log: err,
        message: '更新失败！'
      })
    }
  })
}